﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmartMathLibrary;

namespace SmartMathLibrary.NumericalIntegration
{
    /// <summary>
    /// This class represents a finity cubic spline integral.
    /// </summary>
    [Serializable]
    public class FinityCubicSplineIntegral : IFinityCubicSplineIntegral
    {
        /// <summary>
        /// The lower value a of the integral.
        /// </summary>
        private double a;

        /// <summary>
        /// The upper value b of the integral.
        /// </summary>
        private double b;

        /// <summary>
        /// The function of the integral.
        /// </summary>
        private CubicSpline function;

        /// <summary>
        /// Initializes a new instance of the <see cref="FinityCubicSplineIntegral"/> class.
        /// </summary>
        /// <param name="a">The lower value a of the integral.</param>
        /// <param name="b">The upper value b of the integral.</param>
        /// <param name="function">The function of the integral.</param>
        public FinityCubicSplineIntegral(double a, double b, CubicSpline function)
        {
            this.a = a;
            this.b = b;
            this.function = function;
        }

        /// <summary>
        /// Gets or sets the lower value a of the integral.
        /// </summary>
        /// <value>The lower value a of the integral.</value>
        public double A
        {
            get { return a; }
            set { a = value; }
        }

        /// <summary>
        /// Gets or sets the upper value b of the integral.
        /// </summary>
        /// <value>The upper value b of the integral.</value>
        public double B
        {
            get { return b; }
            set { b = value; }
        }

        /// <summary>
        /// Gets or sets the function of the integral.
        /// </summary>
        /// <value>The function of the integral.</value>
        public CubicSpline Function
        {
            get { return function; }
            set { function = value; }
        }
    }
}